-- GENERATED SPELL FOR [Eldreth Apparition] --


function spell0_11471(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(22744,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11471', 11000, 1)
end

function spell1_11471(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(15244,pUnit)
pUnit:RegisterEvent('Sorts_11471', 8252, 1)
end

function spell2_11471(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(18100,pUnit)
pUnit:RegisterEvent('Sorts_11471', 0, 1)
end

function spell3_11471(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(16799,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11471', 5000, 1)
end

function Sorts_11471(pUnit, Event)
local choix_sorts_11471 = math.random(0, 3)
if choix_sorts_11471 == 0 then
pUnit:RegisterEvent('spell0_11471', 1, 1)
end
if choix_sorts_11471 == 1 then
pUnit:RegisterEvent('spell1_11471', 1, 1)
end
if choix_sorts_11471 == 2 then
pUnit:RegisterEvent('spell2_11471', 1, 1)
end
if choix_sorts_11471 == 3 then
pUnit:RegisterEvent('spell3_11471', 1, 1)
end
end

function mob11471_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11471', math.random(1500, 3000), 1)
end

function mob11471_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11471_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11471_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11471, 1, 'mob11471_Action')
RegisterUnitEvent(11471, 2, 'mob11471_Leave')
RegisterUnitEvent(11471, 3, 'mob11471_Kill')
RegisterUnitEvent(11471, 4, 'mob11471_Die')
